home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / cool / cool.lha / ice / ice_defs / ice_defs.h next >
Encoding:
C/C++ Source or Header  |  1991-09-04  |  1.9 KB  |  66 lines

  1. //
  2. //
  3. // Copyright (C) 1991 Texas Instruments Incorporated.
  4. //
  5. // Permission is granted to any individual or institution to use, copy, modify,
  6. // and distribute this software, provided that this complete copyright and
  7. // permission notice is maintained, intact, in all copies and supporting
  8. // documentation.
  9. //
  10. // Texas Instruments Incorporated provides this software "as is" without
  11. // express or implied warranty.
  12. //
  13. // This file contains common definitions, macros, and constants used by header
  14. // and source files under ICE (such as, COOL and InterViews).  For example, it
  15. // is included by the misc.h header file under COOL  and the def.h header file
  16. // under InterViews.
  17. //
  18.  
  19. #ifndef ICEDEFSH                // If no ice_defs header file
  20. #define ICEDEFSH
  21.  
  22. #ifndef BOOLEANH                // If Boolean type not defined
  23. #define BOOLEANH
  24. typedef int Boolean;                // Define Boolean data type
  25. #endif
  26.  
  27. #undef TRUE                    // ensure TRUE is defined
  28. #define TRUE (1)
  29.  
  30. #undef FALSE                    // ensure FALSE is defined
  31. #define FALSE (0)
  32.  
  33. #undef NULL                    // ensure NULL is defined
  34. #define NULL 0
  35.  
  36. #ifndef __cplusplus
  37. overload min;
  38. overload max;
  39. #endif
  40.  
  41. #if defined(DOS)
  42. extern "C" {
  43. #include <stdlib.h>        // include the standard c library
  44. }
  45. #else
  46. // min --  Return the minimum of two long integers
  47. // Input:  Two long integers
  48. // Output: Smallest of two longs
  49.  
  50. inline char min (char a, char b) {return (a < b) ? a : b;}
  51. inline int min (int a, int b) {return (a < b) ? a : b;}
  52. inline long min (long a, long b) {return (a < b) ? a : b;}
  53. inline double min (double a, double b) {return (a < b) ? a : b;}
  54.  
  55. // max --  Return the maximum of two long integers
  56. // Input:  Two long integers
  57. // Output: Largest of two longs
  58.  
  59. inline char max(char a, char b) {return (a > b) ? a : b;}
  60. inline int max(int a, int b) {return (a > b) ? a : b;}
  61. inline long max(long a, long b) {return (a > b) ? a : b;}
  62. inline double max(double a, double b) {return (a > b) ? a : b;}
  63. #endif
  64.  
  65. #endif ICEDEFSH                // End #ifdef
  66.